home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / music / omdpt123.lha / OMED_PT123.lzx / rexx / replace_cmd.omed < prev    next >
Text File  |  2004-03-03  |  2KB  |  82 lines

  1. /* Replace a command - Feril 13-01-96 */
  2.  
  3. address OCTAMED_REXX
  4. options results
  5.  
  6. 'wi_request "If the command at the current position is the searched click OK!" "OK|Cancel"'
  7. if result = 0 then exit
  8. 'ed_getdata CMDNUM'; scmd = result
  9. 'ed_getdata QUAL'; squal = result
  10.  
  11. do forever
  12. 'wi_request "Go to the cmd to be inserted and click OK" "Ok|<-|->|^|v|Cancel"'
  13. if result = 0 then exit
  14. if result = 2 then ed_gototrack prevnote
  15. if result = 3 then ed_gototrack nextnote
  16. if result = 4 then ed_advanceline up
  17. if result = 5 then ed_advanceline down
  18. if result = 1 then leave
  19. end
  20.  
  21. 'ed_getdata CMDNUM'; dcmd = result
  22. 'ed_getdata QUAL'; dqual = result
  23.  
  24. 'wi_request "Do you want OMED to search all sequences?" "Yes|No|Cancel"'
  25. if result = 0 then exit
  26. if result = 1 then seq = 1
  27. else 'ed_getcurrplayseq var seq'
  28.  
  29. 'wi_open playingseq'
  30.  
  31. 'op_update off'
  32. replaced = 0
  33. do_req = 1
  34. 'ed_getnumplayseq var numseq'
  35.  
  36. do until seq = numseq + 1
  37.     'ed_getcurrplayseq var seq'
  38.     'ed_gotoplayseq' seq
  39.     'ed_getplayseqblock' seq; block = result
  40.     'ed_getnumlines block' block; numlines = result
  41.     'ed_getnumtracks block' block; numtracks = result
  42.     track = 0
  43.     do until track = numtracks  
  44.         line = 0
  45.         do until line = numlines
  46.             'ed_getdata block' block 'track' track 'line' line 'qual'; qual = result
  47.             'ed_getdata block' block 'track' track 'line' line 'cmdnum'; cmd = result
  48.             wi_showstring "Seq:" seq 
  49.             if cmd = scmd then do 
  50.                 if qual = squal then do
  51.                     'ed_goto block' block 'line' line 'track' track
  52.                     if do_req ~= 0 then do
  53.                         'op_update on'
  54.                         'wi_request "Select:" "Replace|Replace All|Skip|Cancel"'
  55.                         req = result
  56.                           if req = 0 then do
  57.                         wi_showstring replaced "replaced"
  58.                         exit
  59.                         end
  60.                     end
  61.                     if req = 1 then do
  62.                         'ed_setdata CMDNUM' dcmd 'QUAL' dqual
  63.                         replaced = replaced + 1
  64.                         do_req = 1
  65.                     end
  66.                     if req = 2 then do
  67.                         'ed_setdata CMDNUM' dcmd 'QUAL' dqual
  68.                         replaced = replaced + 1
  69.                         do_req = 0
  70.                     end
  71.                     'op_update off'
  72.                 end
  73.             end
  74.             line = line + 1
  75.         end
  76.         track = track + 1
  77.     end
  78.     seq = seq + 1
  79. end
  80. wi_showstring replaced "replaced"
  81. 'op_update on'
  82.